package com.meilai.project.mapper.business.media;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.meilai.project.entity.media.MediaPointTypeSpecsRelation;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @Author ljy
 * @Date 2022/5/27 9:02
 */
@Mapper
public interface MediaPointTypeSpecsRelationMapper extends BaseMapper<MediaPointTypeSpecsRelation> {

    @Select("select media_type_specs_id from media_point_type_specs_relation where media_point_id = #{media_point_id} AND deleted_at is NULL")
    Long getTypeSpecsId(@Param("media_point_id") Long media_point_id);

    @Delete("delete from media_point_type_specs_relation where media_point_id = #{media_point_id}")
    int deleteExist(@Param("media_point_id") Long media_point_id);
}
